package com.golang.api.common;

import lombok.Getter;

@Getter
public enum OrderStatusType {

    UnPaid("待支付",0),
    Paid("已支付",1),
    Refunded("已退款",2),
    Cancel("取消",3);



    OrderStatusType(String showName, Integer dbType) {
        this.showName = showName;
        this.dbType = dbType;
    }



    public static OrderStatusType getByDbType(Integer status) {
        OrderStatusType type = null;
        switch (status) {
            case 0:
                type = OrderStatusType.UnPaid;
                break;
            case 1:
                type = OrderStatusType.Paid;
                break;
            case 2:
                type = OrderStatusType.Refunded;
                break;
            case 3:
                type = OrderStatusType.Cancel;
                break;
            default:
                ;
        }

        return type;

    }



    private final String showName;



    private final Integer dbType;




    }
